package com.casstime.ec.cloud.meeting.service;

import com.casstime.ec.cloud.meeting.values.BookDetailDTO;
import com.casstime.ec.cloud.meeting.values.BookDetailQuery;
import com.casstime.ec.cloud.meeting.values.BookMeetingRoomParam;
import com.casstime.ec.cloud.meeting.values.BookRoomQuery;
import com.casstime.ec.cloud.meeting.values.BookRoomResult;
import com.casstime.ec.cloud.meeting.values.DepartmentDTO;
import com.casstime.ec.cloud.meeting.values.EquipDTO;
import com.casstime.ec.cloud.meeting.values.MeetingRoomDTO;
import com.casstime.ec.cloud.meeting.values.MeetingRoomQuery;
import com.casstime.ec.cloud.meeting.values.MeetingRoomSaveParam;
import com.casstime.ec.cloud.meeting.values.ResultBookMeetingRoom;
import com.casstime.ec.cloud.meeting.values.ResultDeleteMyBook;
import com.casstime.ec.cloud.meeting.values.UserDTO;
import io.swagger.annotations.Api;
import java.util.List;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by Administrator on 2018/7/16.
 * @author wyl & lx
 */
@Api
public interface MeetingService {

  /**
   * 保存会议室
   * @param meetingRoomSaveParam
   * @return
   * @throws Exception
   */
  @RequestMapping(method = RequestMethod.POST, value = "/room/saveMeetingRoom")
  public MeetingRoomDTO saveMeetingRoom(@RequestBody MeetingRoomSaveParam meetingRoomSaveParam) throws Exception;


  /**
   * 删除会议室
   * @param roomName
   * @return
   * @throws Exception
   */
  @RequestMapping(method = RequestMethod.GET, value = "/room/removeMeetingRoomByName")
  public int removeMeetingRoomByName(@RequestParam("roomName")String roomName) throws Exception;



  /**
   * 查询所有会议室列表
   * @return
   * @throws Exception
   */
  @RequestMapping(method = RequestMethod.GET, value = "/room/getMeetingRoomList")
  public List<MeetingRoomDTO> getMeetingRoomList() throws Exception;

  /**
   * 根据ID查询会议室详情
   * @param  meetingRoomId
   * @return
   * @throws Exception
   */
  @RequestMapping(method = RequestMethod.GET, value = "/room/getMeetingRoomById")
  public MeetingRoomDTO getMeetingRoomById(@RequestParam("meetingRoomId") Integer meetingRoomId) throws Exception;


  /**
   * 根据会议室名称查询会议室
   * @param meetingRoomName
   * @return
   * @throws Exception
   */
  @RequestMapping(method = RequestMethod.GET, value = "/room/getMeetingRoomByName")
  public List<MeetingRoomDTO> getMeetingRoomByName(@RequestParam("meetingRoomName") String meetingRoomName) throws Exception;

  /**
   * 根据会议室状态查询会议室
   * @param meetingRoomNameStatus
   * @return
   * @throws Exception
   */
  @RequestMapping(method = RequestMethod.GET, value = "/room/getMeetingRoomByStatus")
  public List<MeetingRoomDTO> getMeetingRoomByStatus(@RequestParam("meetingRoomNameStatus") Integer meetingRoomNameStatus) throws Exception;

  /**
   * 组合条件查询会议室列表
   * @param meetingRoomQuery
   * @return
   * @throws Exception
   */
  @RequestMapping(method = RequestMethod.POST, value = "/room/getMeetingRoomListByQuery")
  public  List<MeetingRoomDTO> getMeetingRoomListByQuery(@RequestBody MeetingRoomQuery meetingRoomQuery) throws Exception;








  /**
   * 查询已预约的会议日程
   * @param roomQuery
   * @return
   * @throws Exception
   */
  @RequestMapping(method = RequestMethod.POST, value = "/rooms/books")
  public List<BookRoomResult> getBookRooms(@RequestBody BookRoomQuery roomQuery) throws Exception;


  /**
   * 修改会议预约
   * @param roomQuery
   * @return
   * @throws Exception
   */
  @RequestMapping(method = RequestMethod.PUT, value = "/books")
  public BookDetailDTO changeBookRoom(@RequestBody BookMeetingRoomParam roomQuery) throws Exception;


  /**
   * 根据id查询会议详情
   * @param bookDetailId
   * @return
   * @throws Exception
   */
  @RequestMapping(method = RequestMethod.GET, value = "/book/getBookDetailById")
  public BookDetailDTO getBookDetailById(@RequestParam("bookDetailId") Integer bookDetailId) throws Exception;



  @RequestMapping(method = RequestMethod.POST, value="/book/getBookDetailList")
  public List<BookDetailDTO> getBookDetailList() throws Exception;



  /**
   * 登陆
   * @param user
   * @return
   * @throws Exception
   */
  @RequestMapping(method = RequestMethod.POST, value = "/user/login")
  public UserDTO userLogin(@RequestBody UserDTO user) throws Exception;


  /**
   * 按指定日期和会议室查询当天的预约详情
   * @param bookDetailQuery
   * @return
   * @throws Exception
   */
  @RequestMapping(method = RequestMethod.POST, value = "/book/getBookDetailByQuery")
  public List<BookDetailDTO> getBookDetailByQuery(@RequestBody  BookDetailQuery bookDetailQuery) throws Exception;


  /**
   * 通过用户的id查询与用户相关的预约详情
   * @return
   * @throws Exception
   */
  @RequestMapping(method = RequestMethod.GET, value="/book/getBookDetailByUserId")
  public List<BookDetailDTO> getBookDetailByUserId(@RequestParam("id") Integer userId) throws Exception;



  /**
   * 查询某个用户所属部门
   * @return
   * @throws Exception
   */
  @RequestMapping(value = "/user/getDepartment", method = RequestMethod.GET)
  @ResponseBody
  public DepartmentDTO getDepartmentByUserId(@RequestParam("userId") Integer userId) throws Exception;

  /**
   * 查询某个会议室的设备
   * @param roomId
   * @return
   * @throws Exception
   */
  @RequestMapping(value = "/applyEquip/applyEquiplist", method = RequestMethod.POST)
  @ResponseBody
  public List<EquipDTO> getEquipByRoomId(@RequestParam("roomId") Integer roomId) throws  Exception;


  /**
   * 预约会议室
   * @param bookMeetingRoomParam
   * @return
   * @throws Exception
   */
  @RequestMapping(method = RequestMethod.POST, value = "/rooms/bookMeetingRoom")
  public ResultBookMeetingRoom bookMeetingRoom(@RequestBody BookMeetingRoomParam bookMeetingRoomParam) throws Exception;


  /**
   * 删除一条我的预约信息
   * @param bookId
   * @return
   * @throws Exception
   */
  @RequestMapping(method = RequestMethod.GET, value = "/books/deleteMyBook")
  public ResultDeleteMyBook deleteMyBook(@RequestParam("bookId") Integer bookId) throws Exception;

}
